package org.oslims.domain;

import java.util.ArrayList;
import java.util.List;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.ManyToMany;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;

@Entity
public abstract class LabStaff extends BaseUser {

	/**
	 * 
	 */
	private static final long serialVersionUID = -2987821624006998914L;

	@ManyToMany(targetEntity = Department.class, cascade = CascadeType.ALL)
	@OrderBy("name")
	private List<Department> departments = new ArrayList<Department>();

	@OneToMany(mappedBy = "owner")
	private List<SOP> ownedSOPs = new ArrayList<SOP>();

	@OneToMany(mappedBy = "writtenBy")
	private List<Report> reports = new ArrayList<Report>();

	@OneToMany(mappedBy = "assignedBy")
	private List<AnalysisResult> analysisResults = new ArrayList<AnalysisResult>();

	@OneToMany(mappedBy = "scientValBy")
	private List<ParameterResult> parameterResults = new ArrayList<ParameterResult>();

	public void setDepartments(List<Department> departments) {
		this.departments = departments;
	}

	public List<Department> getDepartments() {
		return departments;
	}

	public void setOwnedSOPs(List<SOP> ownedSOPs) {
		this.ownedSOPs = ownedSOPs;
	}

	public List<SOP> getOwnedSOPs() {
		return ownedSOPs;
	}

	public void setReports(List<Report> reports) {
		this.reports = reports;
	}

	public List<Report> getReports() {
		return reports;
	}

	public void setAnalysisResults(List<AnalysisResult> analysisResults) {
		this.analysisResults = analysisResults;
	}

	public List<AnalysisResult> getAnalysisResults() {
		return analysisResults;
	}

	public void setParameterResults(List<ParameterResult> parameterResults) {
		this.parameterResults = parameterResults;
	}

	public List<ParameterResult> getParameterResults() {
		return parameterResults;
	}
}
